package cn.cqie.attendance.manager.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author 697
 * @date 2021/7/8 10:49
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="AttendanceAdd对象", description="")
@AllArgsConstructor
@NoArgsConstructor
public class AdminAttendanceAdd extends Model {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "学生id")
    private Integer stuId;

    @ApiModelProperty(value = "考勤情况：0 正常 1 迟到 2 早退 3 请假 4 缺勤")
    private int status;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "实际签到时间")
    private Date trueSignInTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "实际签退时间")
    private Date trueSignOutTime;

    @ApiModelProperty(value = "打卡设备(打卡的教室)")
    private String punchDevice;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty(value = "打卡时间")
    private Date punchDate;

    @ApiModelProperty(value = "请假id")
    private Integer leaveId;

    @ApiModelProperty(value = "课程id")
    private Integer courseId;

    public AdminAttendanceAdd(Integer stuId, String punchDevice, Integer courseId) {
        this.stuId = stuId;
        this.punchDevice = punchDevice;
        this.courseId = courseId;
    }

    public AdminAttendanceAdd(Integer stuId, Date punchDate, Integer leaveId, Integer courseId) {
        this.stuId = stuId;
        this.punchDate = punchDate;
        this.leaveId = leaveId;
        this.courseId = courseId;
    }
}
